home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 4 / Windows 6-Pak (InfoMagic) (Disc 4) (1999).ISO / Text-Chat-Scripts / pp-320m.exe / pp300 / a-main1.mrc < prev    next >
Text File  |  1998-10-10  |  28KB  |  634 lines

  1. ; -----------------------------------------------------
  2. ; Peace and Protection (by misspai)
  3. ; -----------------------------------------------------
  4. ; Main (normal) aliases
  5. ; (First section)
  6. ; -----------------------------------------------------
  7. ; Kicking and banning
  8. ; -----------------------------------------------------
  9. kick {
  10.   _psplit kk $1-
  11.   if (%.kk.nick == $null) _quickhelp /kick
  12.   if ($_ismask(%.kk.nick)) { fk $1- | return }
  13.   if (%+nick.complete.cmd) {
  14.     set %.kk.comp $_nickcomp(%.kk.nick,%.kk.chan)
  15.     if (%.kk.comp != $null) set %.kk.nick %.kk.comp
  16.   }
  17.   if (%.kk.msg == $null) set %.kk.msg $_kickmsg(%.kk.chan,%.kk.nick)
  18.   else set %.kk.msg $_kickwrap(%.kk.chan,%.kk.nick,%.kk.msg)
  19.   _usexw %.kk.chan kick kick
  20.   if (%.xw != $null) {
  21.     dispr %.kk.chan Using %col.target $+ %.xw $+  to kick %col.target $+ %.kk.nick $+ ...
  22.     if (%.xw isin X.W) _privmsg %.xw kick %.kk.chan %.kk.nick %.kk.msg
  23.     elseif (%.xw == ChanServ) _error You cannot use ChanServ to simply kick users.
  24.     else _botcmd %.xw %.kk.chan %.kk.nick %.kk.msg
  25.   }
  26.   else {
  27.     if ($_ismask(%.kk.nick)) fk $1-
  28.     else .raw kick %.kk.chan %.kk.nick : $+ %.kk.msg
  29.   }
  30. }
  31. k kick $1-
  32. kb set %.kk.type 3 | set %.kk.cmd /kb | _ppkb $1-
  33. kb2 set %.kk.type 4 | set %.kk.cmd /kb2 | _ppkb $1-
  34. kb0 set %.kk.type 2 | set %.kk.cmd /kb0 | _ppkb $1-
  35. bk kb $1-
  36. bk2 kb2 $1-
  37. bk0 kb0 $1-
  38. _ppkb {
  39.   if ($left($1,2) == -u) { _psplit kk $2- | set %.kk.time $remove($1,-u) }
  40.   else { _psplit kk $1- | set %.kk.time 0 }
  41.   if (%.kk.nick == $null) _quickhelp %.kk.cmd
  42.   if ($_ismask(%.kk.nick)) { cb $1- | halt }
  43.   if (%+nick.complete.cmd) {
  44.     set %.kk.comp $_nickcomp(%.kk.nick,%.kk.chan)
  45.     if (%.kk.comp != $null) set %.kk.nick %.kk.comp
  46.   }
  47.   if (%.kk.time > 0) {
  48.     if (%.kk.msg == $null) set %.kk.msg $_tkickmsg(%.kk.chan,%.kk.nick,%.kk.time)
  49.     else set %.kk.msg $_tkickwrap(%.kk.chan,%.kk.nick,%.kk.time,%.kk.msg)
  50.   }
  51.   else {
  52.     if (%.kk.msg == $null) set %.kk.msg $_kickmsg(%.kk.chan,%.kk.nick)
  53.     else set %.kk.msg $_kickwrap(%.kk.chan,%.kk.nick,%.kk.msg)
  54.   }
  55.   set %.kk.myself $me $+ ! $+ %-my.address
  56.   set %.kk.mask $_ppmask(%.kk.nick,%.kk.type)
  57.   if (%.kk.mask iswm %.kk.myself) set %.kk.mask $_ppmask(%.kk.nick,1)
  58.   _usexw %.kk.chan kickban ban
  59.   if (%.xw != $null) {
  60.     if (%.xw == ChanServ) {
  61.       dispr %.kk.chan Using %col.target $+ ChanServ to add %col.target $+ %.kk.nick $+  to akick list...
  62.       cs akick %.kk.chan add %.kk.mask
  63.     }
  64.     else {
  65.       dispr %.kk.chan Using %col.target $+ %.xw $+  to kickban %col.target $+ %.kk.nick $+ ...
  66.       if (%.xw isin X.W) _privmsg %.xw ban %.kk.chan %.kk.mask 168 75 %.kk.msg
  67.       else _botcmd %.xw %.kk.chan %.kk.mask %.kk.msg
  68.     }
  69.   }
  70.   else {
  71.     .raw mode %.kk.chan -o+b %.kk.nick %.kk.mask
  72.     .raw kick %.kk.chan %.kk.nick : $+ %.kk.msg
  73.   }
  74.   if (%.kk.time > 0) tunban %.kk.time %.kk.chan %.kk.mask
  75.   set %_recent.ban. [ $+ [ %.kk.chan ] ] %.kk.mask
  76. }
  77. tempban set %.kk.type 2 | set %.kk.cmd /tempban | _ppkb -u20 $1-
  78. tempkb tempban $1-
  79. tempbk tempban $1-
  80. kbtemp tempban $1-
  81. bktemp tempban $1-
  82. bantemp tempban $1-
  83. ban {
  84.   if ($left($1,2) == -u) { _psplit bb $2- | set %.bb.time $remove($1,-u) }
  85.   else { _psplit bb $1- | set %.bb.time 0 }
  86.   if ($gettok(%.bb.msg,1,32) isnum) { set %.bb.lvl $gettok(%.bb.msg,1,32) | set %.bb.msg $gettok(%.bb.msg,2-,32) }
  87.   else set %.bb.lvl 3
  88.   if (%.bb.nick == $null) .raw mode %.bb.chan +b
  89.   else {
  90.     if ($_ismask(%.bb.nick) == $false) {
  91.       if (%+nick.complete.cmd) set %.bb.comp $_nickcomp(%.bb.nick,%.bb.chan)
  92.       else unset %.bb.comp
  93.       if (%.bb.comp == $null) set %.bb.comp %.bb.nick
  94.       if ($address(%.bb.comp,5) == $null) _lookup %.bb.comp %.bb.lvl ban -u $+ %.bb.time %.bb.chan , %.bb.msg
  95.       set %.bb.nick $_ppmask(%.bb.comp,%.bb.lvl)
  96.     }
  97.     set %.bb.myself $me $+ ! $+ %-my.address
  98.     if (%.bb.nick iswm %.bb.myself) { dispr %.bb.chan Ban of %col.target $+ %.bb.nick $+  aborted- address matches yours! | return }
  99.     _usexw %.bb.chan ban ban
  100.     if (%.xw != $null) {
  101.       if (%.xw == ChanServ) {
  102.         dispr %.bb.chan Using %col.target $+ ChanServ to add %col.target $+ %.bb.nick $+  to akick list...
  103.         cs akick %.bb.chan add %.bb.nick
  104.       }
  105.       else {
  106.         dispr %.bb.chan Using %col.target $+ %.xw $+  to ban %col.target $+ %.bb.nick $+ ...
  107.         if (%.xw isin X.W) _privmsg %.xw ban %.bb.chan %.bb.nick 336 75 %.bb.msg
  108.         else _botcmd %.xw %.bb.chan %.bb.nick %.bb.msg
  109.       }
  110.     }
  111.     else {
  112.       fdop %.bb.chan %.bb.nick
  113.       .raw mode %.bb.chan +b %.bb.nick
  114.     }    
  115.     if (%.bb.time > 0) tunban %.bb.time %.bb.chan %.bb.nick
  116.     set %_recent.ban. [ $+ [ %.bb.chan ] ] %.bb.nick
  117.   }
  118. }
  119. banlast {
  120.   if ($left($1,2) == -u) { _psplit bb $2- | set %.bb.time $1 }
  121.   else { _psplit bb $1- | unset %.bb.time }
  122.   if (%.bb.nick isnum) set %.bb.lvl %.bb.nick
  123.   else { set %.bb.lvl 3 | set %.bb.msg %.bb.param }
  124.   set %.bb.nick %-recent.part. [ $+ [ %.bb.chan ] ]
  125.   if (%.bb.nick == $null) _error Nobody has parted for you to ban.
  126.   ban %.bb.time %.bb.chan $_ppmask(%.bb.nick,%.bb.lvl) %.bb.msg
  127. }
  128. lastban banlast $1-
  129. tunban set %.tunban $3 $+ $2 | .timerTempBan [ $+ [ $replace($replace(%.tunban,*,&),?,+) ] ] 1 $1 aunban $2 $3
  130. tunban2 set %.tunban $3 $+ $2 | .timerAutoUnban [ $+ [ $replace($replace(%.tunban,*,&),?,+) ] ] 1 $1 aunban $2 $3
  131. aunban if ($me !isop $1) disprs $1 [[ $+ %col.info1 $+ $1 $+ ] Automatic unban of %col.target $+ $2 $+  aborted. (You are not op.) | else .raw mode $1 -b $2
  132. unban {
  133.   _psplit ub $1-
  134.   if (%.ub.nick == $null) set %.ub.nick %_recent.ban. [ $+ [ %.ub.chan ] ]
  135.   if (%.ub.nick == $null) _error No ban given to unban, and no recent bans known.
  136.   if ($gettok(%.ub.msg,1,32) isnum) { set %.ub.lvl $gettok(%.ub.msg,1,32) | set %.ub.msg $gettok(%.ub.msg,2-,32) }
  137.   else set %.ub.lvl 3
  138.   if ($_ismask(%.ub.nick) == $false) {
  139.     set %.ub.nick $_nickglob(%.ub.nick)
  140.     if ($address(%.ub.nick,5) == $null) _lookup %.ub.nick %.ub.lvl unban %.ub.chan , %.ub.msg
  141.     set %.ub.nick $_ppmask(%.ub.nick,%.ub.lvl)
  142.   }
  143.   _usexw %.ub.chan unban unban
  144.   if (%.xw != $null) {
  145.     if (%.xw == ChanServ) {
  146.       dispr %.ub.chan Using %col.target $+ ChanServ to remove %col.target $+ %.ub.nick $+  from akick list...
  147.       cs akick %.ub.chan del %.ub.nick
  148.     }
  149.     else {
  150.       dispr %.ub.chan Using %col.target $+ %.xw $+  to unban %col.target $+ %.ub.nick $+ ...
  151.       if (%.xw isin X.W) _privmsg %.xw unban %.ub.chan %.ub.nick 336 75 %.ub.msg
  152.       else _botcmd %.xw %.ub.chan %.ub.nick %.ub.msg
  153.     }
  154.   }
  155.   else _massmode %.ub.chan -b %.ub.nick %.ub.msg
  156.   set %_recent.unban. [ $+ [ %.ub.chan ] ] %.ub.nick
  157. }
  158. reban {
  159.   _psplit ub $1-
  160.   set %.ub.nick %_recent.unban. [ $+ [ %.ub.chan ] ]
  161.   if (%.ub.nick == $null) _error No recent unbans known, for rebanning.
  162.   _usexw %.ub.chan reban ban
  163.   if (%.xw != $null) {
  164.     if (%.xw == ChanServ) {
  165.       dispr %.ub.chan Using %col.target $+ ChanServ to add %col.target $+ %.ub.nick $+  to akick list...
  166.       cs akick %.ub.chan add %.ub.nick
  167.     }
  168.     else {
  169.       dispr %.ub.chan Using %col.target $+ %.xw $+  to ban %col.target $+ %.ub.nick $+ ...
  170.       if (%.xw isin X.W) _privmsg %.xw ban %.ub.chan %.ub.nick
  171.       else _botcmd %.xw %.ub.chan %.ub.nick
  172.     }
  173.   }
  174.   else .raw mode %.ub.chan +b %.ub.nick
  175.   set %_recent.ban. [ $+ [ %.ub.chan ] ] %.ub.nick
  176. }
  177. cb {
  178.   if ($left($1,2) == -u) { _psplit bb $2- | set %.bb.time $remove($1,-u) }
  179.   else { _psplit bb $1- | set %.bb.time 0 }
  180.   if (%.bb.nick == $null) _quickhelp /cb
  181.   if ($_ismask(%.bb.nick)) {
  182.     if ($ialchan(%.bb.nick,%.bb.chan,0) == 0) return
  183.     _usexw %.bb.chan kickban ban
  184.     if (%.xw != $null) {
  185.       if (%.xw == ChanServ) {
  186.         dispr %.bb.chan Using %col.target $+ ChanServ to add %col.target $+ %.bb.nick $+  to akick list...
  187.         cs akick %.bb.chan add %.bb.nick
  188.       }
  189.       else {
  190.         dispr %.bb.chan Using %col.target $+ %.xw $+  to kickban %col.target $+ %.bb.nick $+ ...
  191.         if (%.bb.msg == $null) set %.bb.msg $_kickmsg(%.bb.chan,%.bb.nick)
  192.         if (%.xw isin X.W) _privmsg %.xw ban %.bb.chan %.bb.nick 168 75 $_kickwrap(%.bb.chan,%.bb.nick,%.bb.msg)
  193.         else _botcmd %.xw %.bb.chan %.bb.nick $_kickwrap(%.bb.chan,%.bb.nick,%.bb.msg)
  194.       }
  195.     }
  196.     else {
  197.       fdop %.bb.chan %.bb.nick
  198.       .raw mode %.bb.chan +b %.bb.nick
  199.       fk %.bb.chan %.bb.nick %.bb.msg
  200.     }
  201.   }
  202.   else {
  203.     if (%+nick.complete.cmd) {
  204.       set %.bb.comp $_nickcomp(%.bb.nick,%.bb.chan)
  205.       if (%.bb.comp != $null) set %.bb.nick %.bb.comp
  206.     }
  207.     if ($address(%.bb.nick,5) == $null) _error No one to ban (address of user  $+ %.bb.nick $+  unknown)
  208.     set %.bb.dynip $_ppmask(%.bb.nick,2)
  209.     set %.bb.identd $_ppmask(%.bb.nick,3)
  210.     set %.bb.myself $me $+ ! $+ %-my.address
  211.     if (($ialchan(%.bb.identd,%.bb.chan,0) >= $ialchan(%.bb.dynip,%.bb.chan,0)) && (%.bb.identd !iswm %.bb.myself)) set %.bb.nick %.bb.identd
  212.     else set %.bb.nick %.bb.dynip
  213.     _usexw %.bb.chan kickban ban
  214.     if (%.xw != $null) {
  215.       if (%.xw == ChanServ) {
  216.         dispr %.bb.chan Using %col.target $+ ChanServ to add %col.target $+ %.bb.nick $+  to akick list...
  217.         cs akick %.bb.chan add %.bb.nick
  218.       }
  219.       else {
  220.         dispr %.bb.chan Using %col.target $+ %.xw $+  to kickban %col.target $+ %.bb.nick $+ ...
  221.         if (%.bb.msg == $null) set %.bb.msg $_kickmsg(%.bb.chan,%.bb.nick)
  222.         if (%.xw isin X.W) _privmsg %.xw ban %.bb.chan %.bb.nick 168 75 $_kickwrap(%.bb.chan,%.bb.nick,%.bb.msg)
  223.         else _botcmd %.xw %.bb.chan %.bb.nick $_kickwrap(%.bb.chan,%.bb.nick,%.bb.msg)
  224.       }
  225.     }
  226.     else {
  227.       fdop %.bb.chan %.bb.nick
  228.       .raw mode %.bb.chan +b %.bb.nick
  229.       fk %.bb.chan %.bb.nick %.bb.msg
  230.     }
  231.   }
  232.   if (%.bb.time > 0) tunban %.bb.time %.bb.chan %.bb.nick
  233.   set %_recent.ban. [ $+ [ %.bb.chan ] ] %.bb.nick
  234. }
  235. cb2 set %.kk.type 4 | set %.kk.cmd /cb2 | _ppcb $1-
  236. cb0 set %.kk.type 2 | set %.kk.cmd /cb0 | _ppcb $1-
  237. _ppcb {
  238.   if ($left($1,2) == -u) { _psplit bb $2- | set %.bb.time $remove($1,-u) }
  239.   else { _psplit bb $1- | set %.bb.time 0 }
  240.   if (%.bb.nick == $null) _quickhelp %.kk.cmd
  241.   if ($_ismask(%.bb.nick)) cb $1-
  242.   else {
  243.     if (%+nick.complete.cmd) {
  244.       set %.bb.comp $_nickcomp(%.bb.nick,%.bb.chan)
  245.       if (%.bb.comp != $null) set %.bb.nick %.bb.comp
  246.     }
  247.     if ($address(%.bb.nick,5) == $null) _error No one to ban (address of user  $+ %.bb.nick $+  unknown)
  248.     set %.bb.nick $_ppmask(%.bb.nick,%.kk.type)
  249.     set %_recent.ban. [ $+ [ %.bb.chan ] ] %.bb.nick
  250.     _usexw %.bb.chan kickban ban
  251.     if (%.xw != $null) {
  252.       if (%.xw == ChanServ) {
  253.         dispr %.bb.chan Using %col.target $+ ChanServ to add %col.target $+ %.bb.nick $+  to akick list...
  254.         cs akick %.bb.chan add %.bb.nick
  255.       }
  256.       else {
  257.         dispr %.bb.chan Using %col.target $+ %.xw $+  to kickban %col.target $+ %.bb.nick $+ ...
  258.         if (%.bb.msg == $null) set %.bb.msg $_kickmsg(%.bb.chan,%.bb.nick)
  259.         if (%.xw isin X.W) _privmsg %.xw ban %.bb.chan %.bb.nick 168 75 $_kickwrap(%.bb.chan,%.bb.nick,%.bb.msg)
  260.         else _botcmd %.xw %.bb.chan %.bb.nick $_kickwrap(%.bb.chan,%.bb.nick,%.bb.msg)
  261.       }
  262.     }
  263.     else {
  264.       fdop %.bb.chan %.bb.nick
  265.       .raw mode %.bb.chan +b %.bb.nick
  266.       fk %.bb.chan %.bb.nick %.bb.msg
  267.     }
  268.   }
  269.   if (%.bb.time > 0) tunban %.bb.time %.bb.chan %.bb.nick
  270.   set %_recent.ban. [ $+ [ %.bb.chan ] ] %.bb.nick
  271. }
  272. bc cb $1-
  273. bc2 cb2 $1-
  274. bc0 cb0 $1-
  275. fk {
  276.   _psplit fk $1-
  277.   if (%.fk.nick == $null) _quickhelp /fk
  278.   if ($_not($_ismask(%.fk.nick))) {
  279.     if (%.fk.nick !ison %.fk.chan) set %.fk.nick * $+ %.fk.nick $+ *
  280.     else set %.fk.nick $_ppmask(%.fk.nick,2)
  281.   }
  282.   _usexw %.fk.chan filterkick kick
  283.   set %.fk.num $ialchan(%.fk.nick,%.fk.chan,0)
  284.   if (%.fk.num == 0) _error No one found to kick (matching the mask of  $+ %.fk.nick $+ )
  285.   if (%.xw != $null) {
  286.     dispr %.fk.chan Using %col.target $+ %.xw $+  to kick %col.target $+ %.fk.nick $+ ...
  287.     if (%.fk.msg == $null) set %.fk.msg $_kickmsg(%.fk.chan,%.fk.nick)
  288.     else set %.fk.msg $_kickwrap(%.fk.chan,%.fk.nick,%.fk.msg)
  289.     if (%.xw isin X.W) _privmsg %.xw kick %.fk.chan %.fk.nick %.fk.msg
  290.     elseif (%.xw == ChanServ) _error You cannot use ChanServ to simply kick users.
  291.     else _botcmd %.xw %.fk.chan %.fk.nick %.fk.msg
  292.   }
  293.   else {
  294.     :loop
  295.     set %.fk.who $ialchan(%.fk.nick,%.fk.chan,%.fk.num).nick
  296.     if (%.fk.who != $me) {
  297.       if (%.fk.msg == $null) .raw kick %.fk.chan %.fk.who : $+ $_kickmsg(%.fk.chan,%.fk.nick)
  298.       else .raw kick %.fk.chan %.fk.who : $+ $_kickwrap(%.fk.chan,%.fk.nick,%.fk.msg)
  299.     }
  300.     if ($_vd(.fk.num) > 0) goto loop
  301.   }
  302. }
  303. fknop {
  304.   _psplit fk $1-
  305.   if (%.fk.nick == $null) _quickhelp /fknop
  306.   if ($_not($_ismask(%.fk.nick))) {
  307.     if (%.fk.nick !ison %.fk.chan) set %.fk.nick * $+ %.fk.nick $+ *
  308.     else set %.fk.nick $_ppmask(%.fk.nick,2)
  309.   }
  310.   if ($me !isop %.fk.chan) _needops2 %.fk.chan filterkick non-ops
  311.   else {
  312.     set %.fk.num $ialchan(%.fk.nick,%.fk.chan,0)
  313.     if (%.fk.num == 0) return
  314.     :loop
  315.     set %.fk.who $ialchan(%.fk.nick,%.fk.chan,%.fk.num).nick
  316.     if (%.fk.who !isop %.fk.chan) {
  317.       if (%.fk.msg == $null) .raw kick %.fk.chan %.fk.who : $+ $_kickmsg(%.fk.chan,%.fk.nick)
  318.       else .raw kick %.fk.chan %.fk.who : $+ $_kickwrap(%.fk.chan,%.fk.nick,%.fk.msg)
  319.     }
  320.     if ($_vd(.fk.num) > 0) goto loop
  321.   }
  322. }
  323. fban {
  324.   _psplit fb $1-
  325.   if (%.fb.nick == $null) _quickhelp /fban
  326.   if ($me !isop %.fb.chan) _needops2 %.fb.chan filterban
  327.   if (* !isin %.fb.nick) set %.fb.nick * $+ %.fb.nick $+ *
  328.   set %.fb.param $_getnicks(%.fb.chan,%.fb.nick,xwnot)
  329.   set %.fb.num $_numtok(32,%.fb.param)
  330.   unset %.fb.toban %.fb.todeop
  331.   :loop
  332.   set %.fb.nick $gettok(%.fb.param,%.fb.num,32)
  333.   if (%.fb.nick isop %.fb.chan) set %.fb.todeop %.fb.todeop %.fb.nick
  334.   set %.fb.dynip $_ppmask(%.fb.nick,2)
  335.   set %.fb.identd $_ppmask(%.fb.nick,3)
  336.   if ($ialchan(%.fb.identd,%.fb.chan,0) >= $ialchan(%.fb.dynip,%.fb.chan,0)) set %.fb.dynip %.fb.identd
  337.   set %.fb.toban %.fb.toban %.fb.identd
  338.   if ($_vd(.fb.num) > 0) goto loop
  339.   _massmode %.fb.chan -o %.fb.todeop
  340.   _massmode %.fb.chan +b %.fb.toban
  341. }
  342. ; -----------------------------------------------------
  343. ; An easy way of sending warning
  344. ; via notice. (for automated kicks)
  345. ; Must use in a chan or give a chan
  346. ; for looking up nicks and stuff.
  347. ; -----------------------------------------------------
  348. warn {
  349.   _psplit kk $1-
  350.   if (%.kk.msg == $null) _quickhelp /warn
  351.   if ($_ismask(%.kk.nick)) set %.kk.nick $ialchan(%.kk.nick,%.kk.chan,1)
  352.   if (%.kk.nick == $null) return
  353.   if (%-warned. [ $+ [ %.kk.nick ] ] > 0) return
  354.   _timersinc 20 -warned. $+ %.kk.nick
  355.   _qnotice %.kk.nick (on %.kk.chan $+ ) %.kk.msg
  356.   dispr %.kk.chan [[ $+ %col.info1 $+ %.kk.chan $+ ] Warning sent to %col.target $+ %.kk.nick $+  - " $+ %.kk.msg $+ "
  357. }
  358. ; -----------------------------------------------------
  359. ; Opping, deopping, voicing, and
  360. ; devoicing
  361. ; -----------------------------------------------------
  362. opme op $1- $me
  363. op {
  364.   _psplit op $1-
  365.   if (%.op.nick == $null) _quickhelp /op
  366.   if ($_ismask(%.op.nick)) fop $1-
  367.   else {
  368.     if (%.op.param == $me) _usexw %.op.chan giveops opme
  369.     else _usexw %.op.chan giveops op
  370.     if (%.xw == $null) _massmode %.op.chan +o $_c2s(%.op.param)
  371.     else {
  372.       dispr %.op.chan Using %col.target $+ %.xw $+  to op %col.target $+ %.op.param $+ ...
  373.       if (%.xw isin X.W) _privmsg %.xw op %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  374.       elseif (%.xw == ChanServ) cs op %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  375.       else _botcmd %.xw %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  376.     }
  377.   }
  378. }
  379. dopme dop $1- $me
  380. dop {
  381.   _psplit op $1-
  382.   if (%.op.nick == $null) _quickhelp /dop
  383.   if ($_ismask(%.op.nick)) fdop $1-
  384.   else {
  385.     _usexw %.op.chan takeops deop
  386.     if (%.xw == $null) _massmode %.op.chan -o $_c2s(%.op.param)
  387.     else {
  388.       dispr %.op.chan Using %col.target $+ %.xw $+  to deop %col.target $+ %.op.param $+ ...
  389.       if (%.xw isin X.W) _privmsg %.xw deop %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  390.       elseif (%.xw == ChanServ) cs op %.op.chan - $+ $_s2sd($_nickcseries(32,%.op.chan,$_c2s(%.op.param)))
  391.       else _botcmd %.xw %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  392.     }
  393.   }
  394. }
  395. deop dop $1-
  396. voc _psplit op $1- | if (%.op.nick == $null) _quickhelp /voc | if ($me !isop %.op.chan) _needops2 %.op.chan voice people | if ($_ismask(%.op.nick)) fvoc $1- | else _massmode %.op.chan +v $_c2s(%.op.param)
  397. dvoc _psplit op $1- | if (%.op.nick == $null) _quickhelp /dvoc | if ($me !isop %.op.chan) _needops2 %.op.chan devoice people | if ($_ismask(%.op.nick)) fdvoc $1- | else _massmode %.op.chan -v $_c2s(%.op.param)
  398. v voc $1-
  399. dv dvoc $1-
  400. dev dvoc $1-
  401. devoc dvoc $1-
  402. fop {
  403.   _psplit op $1-
  404.   if (%.op.nick == $null) _quickhelp /fop
  405.   if (* !isin %.op.nick) set %.op.nick * $+ %.op.nick $+ *
  406.   set %.op.param $_getnicks(%.op.chan,%.op.nick,-o)
  407.   _usexw %.op.chan give ops
  408.   if (%.xw == $null) _massmode %.op.chan +o %.op.param
  409.   else {
  410.     dispr %.op.chan Using %col.target $+ %.xw $+  to op %col.target $+ %.op.param $+ ...
  411.     if (%.xw isin X.W) _privmsg %.xw op %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  412.     elseif (%.xw == ChanServ) cs op %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  413.     else _botcmd %.xw %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  414.   }
  415. }
  416. fdop {
  417.   _psplit op $1-
  418.   if (%.op.nick == $null) _quickhelp /fdop
  419.   if (* !isin %.op.nick) set %.op.nick * $+ %.op.nick $+ *
  420.   set %.op.param $_getnicks(%.op.chan,%.op.nick,xwnot,+o)
  421.   _usexw %.op.chan take ops
  422.   if (%.xw == $null) _massmode %.op.chan -o %.op.param
  423.   else {
  424.     dispr %.op.chan Using %col.target $+ %.xw $+  to deop %col.target $+ %.op.param $+ ...
  425.     if (%.xw isin X.W) _privmsg %.xw deop %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  426.     elseif (%.xw == ChanServ) cs op %.op.chan - $+ $_s2sd($_nickcseries(32,%.op.chan,$_c2s(%.op.param)))
  427.     else _botcmd %.xw %.op.chan $_nickcseries(32,%.op.chan,$_c2s(%.op.param))
  428.   }
  429. }
  430. fdeop fdop $1-
  431. fvoc _psplit op $1- | if (%.op.nick == $null) _quickhelp /fvoc | if ($me !isop %.op.chan) _needops2 %.op.chan voice people | if (* !isin %.op.nick) set %.op.nick * $+ %.op.nick $+ * | _massmode %.op.chan +v $_getnicks(%.op.chan,%.op.nick,xw)
  432. fdvoc _psplit op $1- | if (%.op.nick == $null) _quickhelp /fdvoc | if ($me !isop %.op.chan) _needops2 %.op.chan devoice people | if (* !isin %.op.nick) set %.op.nick * $+ %.op.nick $+ * | _massmode %.op.chan -v $_getnicks(%.op.chan,%.op.nick,xw)
  433. fv fvoc $1-
  434. fdv fdvoc $1-
  435. fdev fdvoc $1-
  436. fdevoc fdvoc $1-
  437. ; -----------------------------------------------------
  438. ; Bot-control (X/W, etc.)
  439. ; -----------------------------------------------------
  440. ch x $1-
  441. x {
  442.   if (($2 == $null) && ($1 != opme) && ($1 != dopme) && ($1 != unban) && ($1 != reban) && ($1 != banlast)) _quickhelp /x
  443.   set %.+usexw $true
  444.   $1-
  445.   unset %.+usexw
  446. }
  447. xmsg if (($chan($active) != $active) || ($_ischan($2)) || ($1 == help) || ($1 == verify) || ($1 == search)) msg x@channels.undernet.org $1- | else msg x@channels.undernet.org $1 $active $2-
  448. wmsg if (($chan($active) != $active) || ($_ischan($2)) || ($1 == help) || ($1 == verify) || ($1 == search)) msg w@channels2.undernet.org $1- | else msg w@channels2.undernet.org $1 $active $2-
  449. cmsg if (($chan($active) != $active) || ($_ischan($2)) || ($1 == help) || ($1 == list)) cs $1- | else cs $1 $active $2-
  450. csmsg cmsg $1-
  451. bot {
  452.   if (($2 == $null) && ($1 != opme)) _quickhelp /bot
  453.   set %.+usebot $true
  454.   $1-
  455.   unset %.+usebot
  456. }
  457. cs if (%pp.net == dalnet) _privmsg chanserv@services.dal.net $1- | else _privmsg chanserv $1-
  458. ns if (%pp.net == dalnet) _privmsg nickserv@services.dal.net $1- | else _privmsg nickserv $1-
  459. ms if (%pp.net == dalnet) _privmsg memoserv@services.dal.net $1- | else _privmsg memoserv $1-
  460. ; -----------------------------------------------------
  461. ; Mass messages (mass notices
  462. ; such as wallops, and messages
  463. ; to all chats/channels/etc.)
  464. ; -----------------------------------------------------
  465. aame if ($1 == $null) _quickhelp /aame | acme $1- | if (($chan(0) > 0) && ($server != $null)) ame $1-
  466. aamsg if ($1 == $null) _quickhelp /aamsg | acmsg $1- | if (($chan(0) > 0) && ($server != $null)) amsg $1-
  467. acme {
  468.   if ($1 == $null) _quickhelp /acme
  469.   set %.aa.num $chat(0)
  470.   if (%.aa.num < 1) return
  471.   :loop
  472.   if ($chat(%.aa.num).status == active) describe = $+ $chat(%.aa.num) $1-
  473.   if ($_vd(.aa.num) > 0) goto loop
  474. }
  475. acmsg {
  476.   if ($1 == $null) _quickhelp /acme
  477.   set %.aa.num $chat(0)
  478.   if (%.aa.num < 1) return
  479.   :loop
  480.   if ($chat(%.aa.num).status == active) msg = $+ $chat(%.aa.num) $1-
  481.   if ($_vd(.aa.num) > 0) goto loop
  482. }
  483. wall {
  484.   _psplit mn $1-
  485.   if (%.mn.param == $null) _quickhelp /wall
  486.   if ($len(%.mn.param) > 300) _error You must enter a message under 300 characters for mass notices.
  487.   set %.mn.send $_opmsg(%.mn.chan,%.mn.param)
  488.   echo $colour(own) -i2 %.mn.chan -> %.mn.send
  489.   if (%+wallopbyuserlist) {
  490.     unset %.mn.to
  491.     set %.mn.num $opnick(%.mn.chan,0)
  492.     if (%.mn.num != 0) {
  493.       :loop1
  494.       set %.mn.nick $opnick(%.mn.chan,%.mn.num)
  495.       if (%.mn.nick != $me) {
  496.         if (op isin $level($address(%.mn.nick,5))) {
  497.           set %.mn.ops %opchan. [ $+ [ $maddress($address(%.mn.nick,5)) ] ]
  498.           if ($findtok(%.mn.ops,%.mn.chan,32) != $null) {
  499.             set %.mn.to %.mn.to %.mn.nick
  500.             if ($calc($len(%.mn.to) + $len(%.mn.send)) > 450) { _qnotice $_s2c(%.mn.to) %.mn.send | unset %.mn.to }
  501.           }
  502.         }
  503.       }
  504.       if ($_vd(.mn.num) > 0) goto loop1
  505.       if (%.mn.to != $null) _qnotice $_s2c(%.mn.to) %.mn.send
  506.     }
  507.   }
  508.   if ((%pp.net == undernet) || (%pp.net == dalnet)) { .raw notice @ $+ %.mn.chan : $+ %.mn.send | return }
  509.   unset %.mn.to
  510.   set %.mn.num $opnick(%.mn.chan,0)
  511.   if (%.mn.num == 0) return
  512.   :loop2
  513.   set %.mn.nick $opnick(%.mn.chan,%.mn.num)
  514.   if (%.mn.nick != $me) set %.mn.to %.mn.to %.mn.nick
  515.   if ($calc($len( [ %.mn.to ] ) + $len(%.mn.send)) > 450) { _qnotice $_s2c(%.mn.to) %.mn.send | unset %.mn.to }
  516.   if ($_vd(.mn.num) > 0) goto loop2
  517.   if (%.mn.to != $null) _qnotice $_s2c(%.mn.to) %.mn.send
  518. }
  519. o wall $1-
  520. onotice wall $1-
  521. wallvoc {
  522.   _psplit mn $1-
  523.   if (%.mn.param == $null) _quickhelp /wallvoc
  524.   if ($len(%.mn.param) > 300) _error You must enter a message under 300 characters for mass notices.
  525.   set %.mn.send $_vocmsg(%.mn.chan,%.mn.param)
  526.   echo $colour(own) -i2 %.mn.chan -> %.mn.send
  527.   if (%+wallopbyuserlist) {
  528.     unset %.mn.to
  529.     set %.mn.num $nopnick(%.mn.chan,0)
  530.     if (%.mn.num != 0) {
  531.       :loop1
  532.       set %.mn.nick $nopnick(%.mn.chan,%.mn.num)
  533.       if (%.mn.nick != $me) {
  534.         if (op isin $level($address(%.mn.nick,5))) {
  535.           set %.mn.ops %opchan. [ $+ [ $maddress($address(%.mn.nick,5)) ] ]
  536.           if ($findtok(%.mn.ops,%.mn.chan,32) != $null) {
  537.             set %.mn.to %.mn.to %.mn.nick
  538.             if ($calc($len(%.mn.to) + $len(%.mn.send)) > 450) { _qnotice $_s2c(%.mn.to) %.mn.send | unset %.mn.to }
  539.           }
  540.         }
  541.       }
  542.       if ($_vd(.mn.num) > 0) goto loop1
  543.       if (%.mn.to != $null) _qnotice $_s2c(%.mn.to) %.mn.send
  544.     }
  545.   }
  546.   unset %.mn.to
  547.   if ((%pp.net == undernet) || (%pp.net == dalnet)) .raw notice @ $+ %.mn.chan : $+ %.mn.send
  548.   else {
  549.     set %.mn.num $opnick(%.mn.chan,0)
  550.     if (%.mn.num > 0) {
  551.       :loop2
  552.       set %.mn.nick $opnick(%.mn.chan,%.mn.num)
  553.       if (%.mn.nick != $me) set %.mn.to %.mn.to %.mn.nick
  554.       if ($calc($len( [ %.mn.to ] ) + $len(%.mn.send)) > 450) { _qnotice $_s2c(%.mn.to) %.mn.send | unset %.mn.to }
  555.       if ($_vd(.mn.num) > 0) goto loop2
  556.     }
  557.   }
  558.   set %.mn.num $vnick(%.mn.chan,0)
  559.   if (%.mn.num > 0) {
  560.     :loop3
  561.     set %.mn.nick $vnick(%.mn.chan,%.mn.num)
  562.     if (%.mn.nick != $me) if (%.mn.nick !isop %.mn.chan) set %.mn.to %.mn.to %.mn.nick
  563.     if ($calc($len( [ %.mn.to ] ) + $len(%.mn.send)) > 450) { _qnotice $_s2c(%.mn.to) %.mn.send | unset %.mn.to }
  564.     if ($_vd(.mn.num) > 0) goto loop3
  565.   }
  566.   if (%.mn.to != $null) _qnotice $_s2c(%.mn.to) %.mn.send
  567. }
  568. ov wallvoc $1-
  569. ovnotice wallvoc $1-
  570. allbut {
  571.   _psplit mn $1-
  572.   if (%.mn.msg == $null) _quickhelp /allbut
  573.   if ($len(%.mn.msg) > 300) _error You must enter a message under 300 characters for mass notices.
  574.   set %.mn.nick $_nickseries(44,%.mn.nick)
  575.   set %.mn.send $_massmsg(AllBut,%.mn.chan,&allbut&,%.mn.nick,%.mn.msg)
  576.   set %.mn.num $_numtok(44,%.mn.nick)
  577.   :loop
  578.   if ($gettok(%.mn.nick,%.mn.num,44) !ison %.mn.chan) _error  $+ $gettok(%.mn.nick,%.mn.num,44) $+  is not on %.mn.chan $+ !
  579.   if ($_vd(.mn.num) > 0) goto loop
  580.   echo $colour(own) -i2 %.mn.chan -> %.mn.send
  581.   unset %.mn.delay %.mn.to
  582.   set %.mn.num $nick(%.mn.chan,0)
  583.   :loop2
  584.   set %.mn.cur $nick(%.mn.chan,%.mn.num)
  585.   if (%.mn.cur != $me) if ($findtok(%.mn.nick,%.mn.cur,44) == $null) set %.mn.to %.mn.to %.mn.cur
  586.   if ($calc($len( [ %.mn.to ] ) + $len(%.mn.send)) > 450) { if (%.mn.delay == $null) _qnotice $_s2c(%.mn.to) %.mn.send | else .timer 1 %.mn.delay _qnotice $_s2c(%.mn.to) %.mn.send | inc %.mn.delay | unset %.mn.to }
  587.   if ($_vd(.mn.num) > 0) goto loop2
  588.   if (%.mn.to != $null) { if (%.mn.delay == $null) _qnotice $_s2c(%.mn.to) %.mn.send | else .timer 1 %.mn.delay _qnotice $_s2c(%.mn.to) %.mn.send }
  589. }
  590. massn {
  591.   _psplit mn $1-
  592.   if (%.mn.param == $null) _quickhelp /massn
  593.   if ($len(%.mn.param) > 300) _error You must enter a message under 300 characters for mass notices.
  594.   set %.mn.num $snick(%.mn.chan,0)
  595.   if (%.mn.num == 0) _error You must select some nicks in the nickname list, as users to send the message to.
  596.   if (%.mn.num == 1) { n $snick(%.mn.chan,1) %.mn.param | halt }
  597.   unset %.mn.delay %.mn.to
  598.   if (%.mn.num < 6) {
  599.     :loop | set %.mn.to %.mn.to $snick(%.mn.chan,%.mn.num) | if ($_vd(.mn.num) > 0) goto loop
  600.     set %.mn.to $_s2c(%.mn.to)
  601.     set %.mn.send $_privn(Mass1,&targets&,%.mn.to,%.mn.param)
  602.     _qnotice %.mn.to %.mn.send
  603.   }
  604.   else {
  605.     set %.mn.send $_privn(Mass2,&targets&,%.mn.num,%.mn.param)
  606.     :loop2
  607.     set %.mn.cur $snick(%.mn.chan,%.mn.num)
  608.     if (%.mn.cur != $me) set %.mn.to %.mn.to %.mn.cur
  609.     if ($calc($len(%.mn.to) + $len(%.mn.send)) > 450) { if (%.mn.delay == $null) disps _qnotice $_s2c(%.mn.to) %.mn.send | else disps .timer 1 %.mn.delay _qnotice $_s2c(%.mn.to) %.mn.send | inc %.mn.delay | unset %.mn.to }
  610.     if ($_vd(.mn.num) > 0) goto loop2
  611.     if (%.mn.to != $null) { if (%.mn.delay == $null) disps _qnotice $_s2c(%.mn.to) %.mn.send | else disps .timer 1 %.mn.delay _qnotice $_s2c(%.mn.to) %.mn.send }
  612.   }
  613.   echo $colour(own) -i2 # -> %.mn.send
  614. }
  615. ; -----------------------------------------------------
  616. ; Repetition of most recent event
  617. ; or notice
  618. ; -----------------------------------------------------
  619. ele if ($1 == $null) editbox -a /say $_stripout(%_last.disp) $+  | else editbox -a /msg $1 $_stripout(%_last.disp) $+ 
  620. sle if ($1 == $null) editbox -a /say $strip(%_last.disp) | else editbox -a /msg $1 $strip(%_last.disp)
  621. rle dispa %_last.disp
  622. eln if ($1 == $null) editbox -a /say  $+ %_last.notice.nick $+  %_last.notice | else editbox -a /msg $1  $+ %_last.notice.nick $+  %_last.notice
  623. sln if ($1 == $null) editbox -a /say  $+ %_last.notice.nick $+  $strip(%_last.notice) | else editbox -a /msg $1  $+ %_last.notice.nick $+  $strip(%_last.notice)
  624. rln dispa  $+ %_last.notice.nick $+  %_last.notice
  625. mtn {
  626.   _psplit mm $replace($1-,+,)
  627.   if ($me !isop %.mm.chan) _needops2 %.mm.chan change the mode
  628.   set %.mm.chan $replace(%.mm.chan,,+)
  629.   set %.mm.mode $remove($remove($remove($gettok($chan(%.mm.chan).mode,1,32),+),t),n)
  630.   if (%pp.net == dalnet) set %.mm.mode $_caserem(%.mm.mode,r)
  631.   .raw mode %.mm.chan +tn- $+ %.mm.mode $chan(%.mm.chan).key
  632.   if (k isin %.mm.mode) .timer923 1 8 _chkkey %.mm.chan
  633. }
  634.